package com.basic;

import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

/**
 * 功能描述
 *
 * @author ganxinge
 * @date 2020/8/915:23
 */
@SpringBootApplication
@EnableDubbo
@Slf4j
public class TaskProviderApplication extends SpringBootServletInitializer {

    public static void main(String[] args) {
        SpringApplication.run(TaskProviderApplication.class, args);
        log.info("#####定时任务服务提供者启动成功####");
    }

    /**
     * 继承自SpringBootServletInitializer，并重写configure方法。且这个类应该与项目的Application在同一级目录下
     *             启动类继承自SpringBootServletInitializer方可正常部署至常规tomcat下，其主要能够起到web.xml的作用
     * @param application
     * @return
     */
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(TaskProviderApplication.class);
    }
}
